package Operation;

import Bill.BillList;

import java.sql.SQLException;
import java.util.Scanner;

public class Updata extends MySql implements IOperation{
    @Override
    public void work() throws SQLException {
        System.out.println("请输入你要修改的账单的id");
        Scanner scanner = new Scanner(System.in);
        int id = scanner.nextInt();
        System.out.println("请输入你要修改的列");
        System.out.println("id/时间/金额/收支/备注");
        scanner.nextLine();
        String str = scanner.nextLine();
        if(str.equals("金额")){
            System.out.println("请输入修改后的值");
            int new_money = scanner.nextInt();
            update(id,new_money);
        }else {

            System.out.println("请输入修改后的值");
            String str2 = scanner.nextLine();
            update(id,str,str2);
        }
        System.out.println("===============================");
    }
}
